import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';

export interface ICarEntity extends Document {

    /** CarEntity id */
    id?: (string | null);

    /** CarEntity car */
    car?: (ICar | null);
}

export interface ILocation extends Document {
    /** Location longitude */
    longitude?: (number | null);

    /** Location latitude */
    latitude?: (number | null);
}

export enum CarStatus {
    CS_NOT_SPECIFIED = 0,
    LOCKED = 1,
    UNLOCKING = 2,
    UNLOCKED = 3,
    LOCKING = 4
}

const CarStatusMap = new Map<number, string>()
CarStatusMap.set(0, 'CS_NOT_SPECIFIED')
CarStatusMap.set(1, 'LOCKED')
CarStatusMap.set(2, 'UNLOCKING')
CarStatusMap.set(3, 'UNLOCKED')
CarStatusMap.set(4, 'LOCKING')

export {CarStatusMap}

export interface IDriver extends Document {

    /** Driver id */
    id?: (string | null);

    /** Driver avatarUrl */
    avatarUrl?: (string | null);
}

export interface ICar extends Document {

    /** Car status */
    status?: (CarStatus | null);

    /** Car driver */
    driver?: (IDriver | null);

    /** Car position */
    position?: (ILocation | null);

    /** Car tripId */
    tripId?: (string | null);
}

export type CarParams = BasicPageParams;

export type CarListGetResultModel = BasicFetchResult<ICarEntity[]>
